package com.corpcredit.webapp.action;

import java.io.Serializable;
import java.util.List;

import com.corpcredit.webapp.action.BasePage;
import com.corpcredit.model.Dwtz;
import com.corpcredit.model.Glry;
import com.corpcredit.model.Jbqk;
import com.corpcredit.service.GenericManager;
import com.corpcredit.service.LookupManager;

public class GlryList extends BasePage implements Serializable {
	private GenericManager<Glry, Long> glryManager;
	private LookupManager lookupManager;
	private Jbqk jbqk;
	public void setLookupManager(LookupManager lookupManager)
	{
		this.lookupManager=lookupManager;
	}
	public void setJbqk(Jbqk jbqk)
	{
		this.jbqk=jbqk;
	}
	public void setGlryManager(GenericManager<Glry, Long> glryManager) {
		this.glryManager = glryManager;
	}

	public GlryList() {
		setSortColumn("id"); // sets the default sort column
	}

	public List getGlries() {
//		return sort(glryManager.getAll());
		return sort(lookupManager.findAllByJbqkID(Glry.class, jbqk.getId()));
	}
	
	public String test()
	{
		return "the text from server";
	}
	@Deprecated
	public String isRyidAvailable(String ryid)
	{
		int ryi=0;
		try{
			ryi=Integer.parseInt(ryid);
		}catch(NumberFormatException ex)
		{
			return "人员ID选项请输入数字"+"lookup"+lookupManager;
		}
		
		return ryid+"lookup"+lookupManager;
	}
	
}

